<?php include('base.php')?>
<?php $this->template->startblock('main') ?>
<h3><b>提示信息</b></h3>
<ul class="tr5">
 
	  <li>如果不了解单入口框架的规则请不要随意修改以下资源！</li>
 
	  <li>每一个资源对应一个链接，实际上是由Controller/Action组成，如果选择显示则会生成对应的菜单。</li>
 
	  <li>菜单的默认页是资源分类里的第一个资源，可以通过调整顺序来调整默认页。</li>
 
</ul>

<h3><span style="margin-right:2em">资源列表</span> <span class="w"><a style="cursor:pointer;" onclick="setall('open');" href="javascript:scroll(0,0)">全部展开</a> | <a style="cursor:pointer;" onclick="setall('close');" href="javascript:scroll(0,0)">全部关闭</a></span></h3>
<table cellspacing="0" cellpadding="0" width="100%" id="ftable">
	<tr class="tr3 s3">
		<td class="tal" style="padding-left:30px">[顺序]资源名称</td>
		<td class="tal" width="30%">资源链接</td>
		<td class="tal" width="15%">是否显示</td>
		<td class="tal" width="7%">编辑</td>
		<td class="tal" width="7%">删除</td>
	</tr>
	<tr id="addpri" class="tr3 tips" style="display:none">
		<td>
			<a href="javascript:void(0)" onclick="delRecord(this)"><span class="close fl"></span></a>
			<input class="input tac" name="ordernum[]" value="0" size="2" type="text" />
			添加资源：<input type="text" size="40" class="input" name="p_name[]" value="" />
		</td>
		<td>
			<input type="text" size="30" class="input" name="p_action[]" value="" />
		</td>
		<td colspan="3"><input type="checkbox" name="show_nav[]" value="1" /></td>
	</tr>

<?php
	foreach($pcarr as $key=>$value){
?>
	<tr class="tr3" onmouseover="$('#addbt_<?php echo $value['pc_id']?>').show()" onmouseout="$('#addbt_<?php echo $value['pc_id']?>').hide()">
		<td class="tal" colspan="2">
			<span id="bt_<?php echo $value['pc_id']?>" class="close fl" onclick="cateopen('<?php echo $value['pc_id']?>')"></span><input class="input tac" name="order" value="<?php echo $value['ordernum']?>" size="2" type="text" readonly/>
<font class="gray">ID:<?php echo $value['pc_id']?></font><?php echo $value['pc_name']?>&nbsp;&nbsp;<a href="javascript:void(0)" title="添加资源" style="display:none;" id="addbt_<?php echo $value['pc_id']?>" onclick="$('#priTable<?php echo $value['pc_id']?>').toggle()">添加资源</a>
		</td>
		<?php echo $value['show_nav']?'<td class="s1">是</td>':'<td class="gray">否</td>';?>
		<td><a class="fourm-two" href="<?php echo site_url();?>admin/editprivilege/pcid/<?php echo $value['pc_id']?>"><span class="edit" title="编辑"></span></a></td>
		<td><a class="fourm-two" href="javascript:void(0);" onclick="checkdel('<?php echo site_url();?>post/delprivilege/pcid/<?php echo $value['pc_id']?>')"><span class="del" title="删除"></span></a></td>
	</tr>
	<form action="<?php echo site_url();?>post/addprivilege" method="post">
	<input type="hidden" name="pc_id" value="<?php echo $value['pc_id']?>"/>
	<tbody id="priTable<?php echo $value['pc_id']?>" style="display:none">
		<tr class="tr3 tips">
			<td>
				<a href="javascript:void(0)" onclick="addRecord('addpri','priTable<?php echo $value['pc_id']?>')"><span class="open fl"></span></a>
				<a href="javascript:void(0)" onclick="$('#priTable<?php echo $value['pc_id']?>').hide()"><span class="close fl"></span></a>
				<input class="input tac" name="ordernum[]" value="0" size="2" type="text"/>
				添加资源：<input type="text" size="40" class="input" name="p_name[]" value="" />
			</td>
			<td>
				<input type="text" size="30" class="input" name="p_action[]" value="" />
			</td>
			<td colspan="2"><input type="checkbox" name="show_nav[]" value="1" /></td>
			<td><input name="submit" type="submit" value="提 交" class="btn" /></td>
		</tr>
	</tbody> 
	</form>
	<tbody id="cate_<?php echo $value['pc_id']?>">
<?php
	foreach($value['parr'] as $val){
?>
		<tr class="tr3">
			<td class="tal">
				<div class="fourm">
				<input class="input tac" name="order" value="<?php echo $val['ordernum']?>" size="2" type="text" readonly/>
				<font class="gray">ID:<?php echo $val['p_id']?></font><span class="fourm-one"></span><?php echo $val['p_name']?>
				</div>
			</td>
			<td><?php echo $val['p_action']?></td>
			<?php echo $val['show_nav']?'<td class="s1">是</td>':'<td class="gray">否</td>';?>
			<td><a class="fourm-two" href="<?php echo site_url();?>admin/editprivilege/pid/<?php echo $val['p_id']?>"><span class="edit" title="编辑"></span></a></td>
			<td><a class="fourm-two" href="javascript:void(0);" onclick="checkdel('<?php echo site_url();?>post/delprivilege/pid/<?php echo $val['p_id']?>')"><span class="del" title="删除"></span></a></td>
		</tr>
<?php }?>
	</tbody>
<?php }?>
	<tr id="addpric" class="tr3 tips" style="display:none">
		<td colspan="2">
			<a href="javascript:void(0)" onclick="delRecord(this)"><span class="close fl"></span></a>
			<input class="input tac" name="ordernum[]" value="0" size="2" type="text"/>
			添加资源分类：<input type="text" size="40" class="input" name="pc_name[]" value="" />
		</td>
		<td colspan="3"><input type="checkbox" name="show_nav[]" value="1" /></td>
	</tr>

	<form id="pricForm" action="<?php echo site_url();?>post/addprivilegecate" method="post">
	<tbody id="pricTable">
		<tr class="tr3 tips">
			<td colspan="2">
				<a href="javascript:void(0)" onclick="addRecord('addpric','pricTable')"><span class="open fl"></span></a>
				<input class="input tac" name="ordernum[]" value="0" size="2" type="text" />
				添加资源分类：<input type="text" size="40" class="input" name="pc_name[]" value="" />
			</td>
			<td colspan="2"><input type="checkbox" name="show_nav[]" value="1" /></td>
			<td><input name="submit" type="submit" value="提 交" class="btn" /></td>
		</tr>
	</tbody>
	</form>
</table>
<?php $this->template->endblock() ?>